package 方法重写;

public class Cat extends Animal{
    //方法重写
    @Override
    public void eat(){
        System.out.println(name+"吃鱼");
    }
    @Override
    public void duty(){
        System.out.println(name+"会捉老鼠");
    }
    //成员特有方法
    public void showCat(){
        System.out.println("名字："+name+'\n'+"年龄："+age+'\n'+"种类："+sex);
    }
}
